home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / C / Frameworks / Extension Shell 1.4 / Extension Shell 1.4 (Source) / ES Address Table.c < prev    next >
C/C++ Source or Header  |  1995-11-01  |  2KB  |  102 lines

  1. /*    NAME:
  2.         ES Address Table.c
  3.  
  4.     WRITTEN BY:
  5.         Dair Grant
  6.  
  7.     DESCRIPTION:
  8.         This file contains a a code resource that acts as a Gestalt Selector
  9.         function to be installed as an address table. When called, it will
  10.         return the address of its internal address table.
  11.  
  12.     ___________________________________________________________________________
  13. */
  14. //=============================================================================
  15. //        Include files                                                                     
  16. //-----------------------------------------------------------------------------
  17. #include "A4Stuff.h"
  18. #include "SetupA4.h"
  19. #include "ES Address Table.h"
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35. //=============================================================================
  36. //        Function prototypes                                                                     
  37. //-----------------------------------------------------------------------------
  38. pascal OSErr main(OSType theSelector, long *theResponse);
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54. //=============================================================================
  55. //        Global variables                                                                 
  56. //-----------------------------------------------------------------------------
  57. ESAddressTable        gTheAddressTable;
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73. //=============================================================================
  74. //        main : Entry point to our Gestalt Selector function.                                                                 
  75. //-----------------------------------------------------------------------------
  76. //        Note :    When called, we return the address of our address table
  77. //                structure.
  78. //-----------------------------------------------------------------------------
  79. pascal OSErr main(OSType theSelector, long *theResponse)
  80. {    long            oldA4;
  81.  
  82.  
  83.  
  84.     // Set up A4 to access our globals
  85. #ifndef powerc
  86.     oldA4 = SetCurrentA4();
  87. #endif
  88.  
  89.                 
  90.     // Return the address of gTheAddressTable. We treat theResponse as a pointer
  91.     // to a variable that's a pointer to an address table, and write to it
  92.     // accordingly.
  93.     *theResponse = (long) &gTheAddressTable;
  94.  
  95.  
  96.     // Restore A4 and return
  97. #ifndef powerc
  98.     SetA4(oldA4);
  99. #endif
  100.     return(noErr);
  101. }
  102.